package com.feicheng.common.advice;

import com.feicheng.common.cache.Cache;
import com.feicheng.service.IFProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

@Component
public class AppStartListener implements ApplicationListener<ContextRefreshedEvent> {

    @Autowired
    IFProductService productService;


    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("hahaha");
        productService.initCategoryCache();
    }
}
